package com.fqgj.sentry.policy.dao.impl;

import com.fqgj.common.base.AbstractBaseMapper;
import com.fqgj.sentry.policy.dao.PcExecuteResultDao;
import com.fqgj.sentry.policy.entity.PcExecuteResultEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;

/**
 * User: yujianfu
 * Date: 2017-07-12
 * Time: 09:37:58.108
 */

@Repository
public class PcExecuteResultDaoImpl extends AbstractBaseMapper<PcExecuteResultEntity> implements PcExecuteResultDao {

    @Override
    public List<PcExecuteResultEntity> selectExecuteResultList(Long policySetsId) {
        return getSqlSession().selectList(getStatement(".selectExecuteResultList"), policySetsId);
    }

    @Override
    public PcExecuteResultEntity selectExecuteResultByResult(Long policySetsId, String result) {
        HashMap<String, Object> param = new HashMap<>();
        param.put("policySetsId", policySetsId);
        param.put("result", result);
        return getSqlSession().selectOne(getStatement(".selectExecuteResultByResult"), param);
    }

    @Override
    public PcExecuteResultEntity selectMaxLevelExecuteResultList(Long policySetsId) {
        return getSqlSession().selectOne(getStatement(".selectMaxLevelExecuteResultList"), policySetsId);
    }
}